//
//  NSArray+SafeArray.h
//  KanManHua
//
//  Created by Banning on 2017/9/19.
//  Copyright © 2017年 KanManHua. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSArray (Safe)

- (NSString *)stringAtIndex:(NSUInteger)index;
- (id)safeObjectAtIndex:(NSUInteger)index;

@end


typedef id (^TranformWeakObject)(void);

extern TranformWeakObject tranformWeakReference(id object);
extern id returnWeakObject(TranformWeakObject tranform);

@interface NSMutableArray (Safe)

- (void)removeSafeObjectAtIndex:(NSUInteger)index;
- (void)addSafeObject:(id)anObject;
- (void)insertSafeObject:(id)anObject atIndex:(NSUInteger)index;

@end

@interface NSMutableArray (Weak)

- (void)weak_addObject:(id)anyObject;
- (id)weak_getObjectAtIndex:(NSInteger)index;

@end
